<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 200px;
      height: 200px;
      background-color: skyblue;
      border: 1px solid orange;
    }
  </style>
</head>

<body>
  <div class="box">111</div>
  <ul>
    <li class="item">第1个</li>
    <li class="item">第2个</li>
    <li class="item">第3个</li>
    <li class="item">第4个</li>
    <li class="item">第5个</li>
    <li class="item">第6个</li>
    <li class="item">第7个</li>
  </ul>
</body>
<script>
  var box = document.querySelector('.box')
  box.onclick = function () {
    console.log('1111111')
  }
  box.onclick = function () {
    console.log('2222222222')
  }
  box.addEventListener('click', function () {
    console.log('3333333333')
  })
  box.addEventListener('click', function () {
    console.log('44444444')
  })


  var lis = document.querySelectorAll('.item')
  for (let i = 0; i < lis.length; i++) {
    lis[i].addEventListener('click', function () {
      console.log(lis[i].innerHTML)
    }
    )
  }

</script>

</html>